package demo.practice.bit;

import java.util.HashSet;
import java.util.Set;

public class P260 {



    public int[] singleNumber(int[] nums) {
        Set<Integer> s1= new HashSet<>();
        //Set<Integer> s2= new HashSet<>();

        for(Integer i:nums){
            if(s1.contains(i)){
                s1.remove(i);
            }else
                s1.add(i);
        }

        int res[] = new int[2];
        int i=0;
        for (Integer s : s1) {
            res[i++]=s;
        }
        return res;
    }

}
